<%@page import="database.*, beans.*, java.util.*" contentType="text/html" pageEncoding="UTF-8"%>
<%! Category category;%>
<%
        ArrayList<Category> categories = new ArrayList<Category>();
        try {
            DatabaseManager.OpenConnection();
            categories = DatabaseManager.GetCategories();
        } catch (Exception ex) {
        } finally {
            DatabaseManager.CloseConnection();
        }
        ListIterator<Category> iterator = categories.listIterator();
%>
<select name="categoryId" id="selectCategory" style="width:100%">
<%      while (iterator.hasNext()) {
            category = iterator.next();
            out.println("<option value=\"" + category.getId() + "\">" + category.getName() + "</option>");
        }
%>
</select>